package com.note.mq.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.Map;

/**
 * 消息实体
 */
@Data
public class MsgData implements Serializable {

    private static final long serialVersionUID = -2130235470051215090L;

    /**
     * 队列名称
     */
    private String queueName;


    /**
     * 交互机名称
     */
    private String exchangeName;


    /**
     * 要发送的数据
     */
    private Map data;

    private MsgData(){

    }

    /**
     * 构建消息发送体
     * @param queueName
     * @param exchangeName
     * @param data
     * @return
     */
    public static MsgData buildMsg(String queueName,  String exchangeName,Map data ){
        MsgData msgData = new MsgData();
        msgData.setQueueName(queueName);
        msgData.setExchangeName(exchangeName);
        msgData.setData(data);
        return msgData;
    }


}
